package com.example.Cairodio;

import android.app.Application;

/**
 * This class starts the database adapter. Thus, any activity can access
 * the instance of the database through this class.
 * 
 * @author Shokry
 *
 */
public class CairodioApplication extends Application {

	CairodioDbAdapter dbHelper; // Interaction with DB

	/**
	 *@author Shokry 
	 */
	@Override
	public void onCreate() {

		// CREATE DATABASE
		dbHelper = new CairodioDbAdapter(this);
		dbHelper.open();
		// end
		
		super.onCreate();
	}

	/**
	 * @author Shokry
	 * 
	 * This method returns the instance of the DB helper 
	 * which interacts with the database
	 * 
	 * @return
	 */
	public CairodioDbAdapter getAdapter() {
		return dbHelper;
	}

}
